﻿@page "/category/{slug:regex(^(?!-)([a-zA-Z0-9-]){{1,64}}$)}"
@model Moonglade.Web.Pages.CategoryListModel
@{
    ViewBag.TitlePrefix = Model.Cat.DisplayName;
    ViewBag.BodyClass = "body-cat-list bg-gray-1";
    ViewBag.ActionName = "list";
}

<h3 class="mb-4">
    <a class="float-end d-none d-md-block"
       asp-controller="Subscription"
       asp-action="Rss"
       asp-route-slug="@Model.Cat.Slug.ToLower()" target="_blank"
       title="Subscribe @(Model.Cat.DisplayName)">
        <i class="bi-rss font-125rem"></i>
    </a>
    <span>@Model.Cat.DisplayName</span>
    <small class="d-none d-md-inline text-muted">@Model.Cat.Note</small>
</h3>

@if (Model.Posts.Any())
{
    <partial name="_PostList" model="Model.Posts" />
}
else
{
    <div class="text-muted text-center">
        - @SharedLocalizer["No Posts"] -
    </div>
}

<partial name="_LightSwitch" />